<script type="text/javascript">
	$(document).ready(function(){
		
	});
</script>

<?php
	require_once("includes/connect.php");
	require_once("includes/function.php");

  //echo $id, $month_year, $panngan2, $panngan3, $ex1_id, $ex2_id, $ex3_id;
	$id = $_REQUEST["id"];
	
	$month_year = $_REQUEST["month_year"];

	$panngan2 = $_REQUEST["panngan2"];
	$panngan3 = $_REQUEST["panngan3"];

	//$salary = $_REQUEST["salary"];

	$budget_year = $_REQUEST["budget_year"];

	$sql = "SELECT * FROM tbl_init
			WHERE card_id = '$id'
			AND panngan2_id = '$panngan2'
			AND panngan3_id = '$panngan3'
			AND month_year = '$month_year'
			AND budget_year = '$budget_year'
			";
	//echo $sql;

	$db = new myDBS;
	$db->selectDB("account");
	$results = $db->runSQL($sql);

	$numrows = $db->num_rows($results);
	
	
if ($numrows > 0) {
	$rows = $db->fetch_object($results);
?>



<div class="panel panel-success">
<div class="panel-heading">ส่วนที่เพิ่ม</div>
<div class="panel-body">
	<label class="control-label">เงินประจำตำแหน่ง: <?php echo number_format($rows->emoluments, 2); ?></label>
	<label class="control-label">เงินตกเบิก: <?php echo number_format($rows->tok_beuk, 2); ?></label>
	<label class="control-label">ค่ารักษาพยาบาล: <?php echo number_format($rows->medical_fee, 2); ?></label>
	<label class="control-label">การศึกษาบุตร: <?php echo number_format($rows->education, 2); ?></label>
	<label class="control-label">เงินเพิ่ม: <?php echo number_format($rows->extra, 2); ?></label>
	<label class="control-label">ค่าเช่าบ้าน: <?php echo number_format($rows->rent_home, 2); ?></label>
	<label class="control-label">เงินได้อื่นๆ: <?php echo number_format($rows->other1, 2); ?></label>
</div>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">ส่วนที่หัก</div>
<div class="panel-body">
	<label class="control-label">ภาษี: <?php echo number_format($rows->tax, 2); ?></label>
	<label class="control-label">ก.ฌ.: <?php echo number_format($rows->cremation1, 2); ?></label>
	<label class="control-label">สวัสดิการ: <?php echo number_format($rows->welfare, 2); ?></label>
	<label class="control-label">สหกรณ์: <?php echo number_format($rows->cooperative, 2); ?></label>
	<label class="control-label">กู้เทศบาล: <?php echo number_format($rows->loan, 2); ?></label>
	<label class="control-label">ธอ/บงคำ: <?php echo number_format($rows->bongkum, 2); ?></label>
	<label class="control-label">ธอส: <?php echo number_format($rows->ghb, 2); ?></label>
	<label class="control-label">AIA: <?php echo number_format($rows->aia, 2); ?></label>
	<label class="control-label">ก.ฌ. เทศบาล: <?php echo number_format($rows->cremation2, 2); ?></label>
	<label class="control-label">อื่นๆ: <?php echo number_format($rows->other2, 2); ?></label>
</div>
</div>
</div>
<div class="form-actions">
	
	<a href="#" class="btn close-dialog"><i class="icon-remove"></i>ปิด</a>

</div>
</form>

<?php 
	} else {
		echo "ไม่พบข้อมูล";
	}
?>